package cn.mxb.logic.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.mxb.floor.pagination.Result;
import cn.mxb.logic.dao.MxbPolicyDAO;
import cn.mxb.logic.entity.MxbPolicy;
import cn.mxb.logic.service.IMxbPolicyService;

@Service("mxbPolicyService")
public class MxbPolicyServiceImpl  implements IMxbPolicyService {

	@Autowired
	private MxbPolicyDAO mxbPolicyDAO;
	
	
	@Override
	public MxbPolicy findByProperty(String property, String value) {
		return mxbPolicyDAO.findByProperty(property, value);
	}

	/**
	 * 分页
	 */
	@Override
	public Result<MxbPolicy> find(MxbPolicy mxbPolicy, int page, int row) {
		return mxbPolicyDAO.find(mxbPolicy, page, row);
	}

	/**
	 * add
	 */
	@Override
	public MxbPolicy add(MxbPolicy mxbPolicy) {
		return mxbPolicyDAO.save(mxbPolicy);
	}

	@Override
	public void delete(int id) {
		mxbPolicyDAO.remove(MxbPolicy.class,id);
	}
	@Override
	public void update(MxbPolicy mxbPolicy) {
		
	}
	
	@Override
	public List<MxbPolicy> findListByProperty(String property, String value) {
		return mxbPolicyDAO.findListByProperty(property, value);
	}

	/**
	 * 查询全部
	 */
	@Override
	public List<MxbPolicy> findAllList() {
		return mxbPolicyDAO.getAll(MxbPolicy.class);
	}


	
}
